<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Componere\Definition class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="componere-abstract-definition.getreflector.html">« Componere\Abstract\Definition::getReflector</a></li>
      <li style="float: right;"><a href="componere-definition.construct.html">Componere\Definition::__construct »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.componere.html">Componere</a></li>
    <li>The Componere\Definition class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.componere-definition" class="reference">

 <h1 class="title">The Componere\Definition class</h1>
 

 <div class="partintro"><p class="verinfo">(Componere 2 &gt;= 2.1.0)</p>


  <div class="section" id="componere-definition.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    The Definition class allows the programmer to build and register a type at runtime.
   </p>
   <p class="para">
    Should a Definition replace an existing class, the existing class will be restored when the Definition is destroyed.
   </p>
  </div>


  <div class="section" id="componere-definition.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">final</span>
      <span class="modifier">class</span> <strong class="classname">Componere\Definition</strong>
     </span>
     
     <span class="ooclass">
      <span class="modifier">extends</span>
       <a href="class.componere-abstract-definition.html" class="classname">Componere\Abstract\Definition</a>
     </span>
     {</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constructors */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="componere-definition.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>)</div>
<div class="constructorsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$parent</code></span>)</div>
<div class="constructorsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$interfaces</code></span>)</div>
<div class="constructorsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$parent</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$interfaces</code></span>)</div>
    

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.addconstant.html" class="methodname">addConstant</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="class.componere-value.html" class="type Componere\Value">Componere\Value</a></span> <code class="parameter">$value</code></span>): <span class="type"><span class="type Definition">Definition</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.addproperty.html" class="methodname">addProperty</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="class.componere-value.html" class="type Componere\Value">Componere\Value</a></span> <code class="parameter">$value</code></span>): <span class="type"><span class="type Definition">Definition</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.register.html" class="methodname">register</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.isregistered.html" class="methodname">isRegistered</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.getclosure.html" class="methodname">getClosure</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>): <span class="type"><a href="class.closure.html" class="type Closure">Closure</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-definition.getclosures.html" class="methodname">getClosures</a></span>(): <span class="type">array</span></div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-abstract-definition.addinterface.html" class="methodname">Componere\Abstract\Definition::addInterface</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$interface</code></span>): <span class="type"><span class="type Definition">Definition</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-abstract-definition.addmethod.html" class="methodname">Componere\Abstract\Definition::addMethod</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="class.componere-method.html" class="type Componere\Method">Componere\Method</a></span> <code class="parameter">$method</code></span>): <span class="type"><span class="type Definition">Definition</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-abstract-definition.addtrait.html" class="methodname">Componere\Abstract\Definition::addTrait</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$trait</code></span>): <span class="type"><span class="type Definition">Definition</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="componere-abstract-definition.getreflector.html" class="methodname">Componere\Abstract\Definition::getReflector</a></span>(): <span class="type"><a href="class.reflectionclass.html" class="type ReflectionClass">ReflectionClass</a></span></div>


   }</div>


  </div>

 </div>

  






  






  






  






  






  






  






<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="componere-definition.construct.html">Componere\Definition::__construct</a> — Definition Construction</li><li><a href="componere-definition.addconstant.html">Componere\Definition::addConstant</a> — Add Constant</li><li><a href="componere-definition.addproperty.html">Componere\Definition::addProperty</a> — Add Property</li><li><a href="componere-definition.register.html">Componere\Definition::register</a> — Registration</li><li><a href="componere-definition.isregistered.html">Componere\Definition::isRegistered</a> — State Detection</li><li><a href="componere-definition.getclosure.html">Componere\Definition::getClosure</a> — Get Closure</li><li><a href="componere-definition.getclosures.html">Componere\Definition::getClosures</a> — Get Closures</li></ul>
</div>
</div></div></body></html>